/**
 * Created by Admin on 2018/3/5.
 */
/*专利监控图表*/

function PieChartBasic(pieCharto) {
    this.pierender = pieCharto.dom;
    this.pietitle = pieCharto.pietitle ? pieCharto.pietitle : " ";
    this.piedata = pieCharto.piedata;
    this.subtitle = pieCharto.subtitle ? pieCharto.subtitle : "";
    this.bgColor = pieCharto.bgColor ? pieCharto.bgColor : "#fafcfe";
    this.height=pieCharto.height?pieCharto.height:"";
    var self = this;
    return new Highcharts.Chart({
        chart: {
            renderTo: self.pierender,
            backgroundColor: self.bgColor,
            plotBorderWidth: null,
            plotShadow: false,
            type: 'pie',
            height:self.height
        },
        title: {
            text:null
        },
        tooltip: {
            style: {
                fontFamily: "微软雅黑",
                fontSize: '13px'
            },
            pointFormat: '{point.percentage}%</b>',
            percentageDecimals: 2
        },
        plotOptions: {
            pie: {
                size: 140,
                cursor: 'pointer',
                allowPointSelect:true,
                dataLabels: {
                    enabled: true,
                    style: {
                        fontFamily: "微软雅黑",
                        fontSize: '13px'
                    },
                    color: '#333',
                    connectorColor: '#000000',
                    formatter: function() {
                        return this.point.name + '<br/>' +
                            this.point.y.toFixed(2)+' %';
                    },
                },
                showInLegend: false
            }
        },
        credits: {
            enabled: false
        },
        legend: {
            align: 'right',
            layout: 'vertical',
            verticalAlign: 'bottom',
            floating: true,
            backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
            borderWidth: 0
        },
        colors: ["#feb754", "#84c354", "#6ba2da"],
        series: [{
            type: 'pie',
            name: 'Browser share',
            data: self.piedata[0]
        }]
    });
}

